import {
  ajax,
} from '../utils/http-request.js';

/**
 * 重定向获取微信code
 */
export const getWechatCode = (param) => {
  const url = `om/api/wx/getWechatCode`;
  return ajax(url, param, {
    method: 'get',
  });
};

/**
 * 查询openid
 */
export const getWechatOpenId = (param) => {
  const url = `om/api/wx/getWechatOpenId`;
  return ajax(url, param, {
    unCheckToken: true,
  });
};

/**
 * 查询微信配置
 */
export const getWxCodeConfig = (param) => {
  const url = `om/api/wx/getWxCodeConfig`;
  return ajax(url, param, {
    unCheckToken: true,
  });
};

export default {
  getWechatCode,
  getWechatOpenId,
  getWxCodeConfig,
};
